package com.leyou.common.pojo;

import com.leyou.common.utils.JsonUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
    String name;
    Integer age;

}
class demo{
    public static void main(String[] args) {
        User user = new User("jack", 21);
        String json = JsonUtils.toString(user);
        System.out.println("json = " + json);
        User user1 = JsonUtils.toBean(json, User.class);
        System.out.println("user1 = " + user1);
    }
}